import {request} from './request'
import {DelPatchListData, ESearchModelData} from '../entityapi/base'
import {ExceptionInfoData} from '../entityapi/base'
// 获取数据，通过
export function getExceptionListAPI(searchModel: ESearchModelData) {
    return request({
        url: '/warning/getWarnList',//此处为自己请求地址
        method: 'get',
        params:{//传参数对应param接收
            currentPage: searchModel.currentPage,
            pageSize: searchModel.pageSize,
            cameraName: searchModel.cameraName,
            orgName: searchModel.orgName,
            beginTime:searchModel.begin_time,
            endTime:searchModel.end_time,
            warn_content: searchModel.warn_content,
            warn_type: searchModel.warn_type
        }
    })
}
//add
export function addExceptionInfoAPI(exceptionListData: ExceptionInfoData) {
    return request({
        url: '/warning/add_exception',//此处为自己请求地址
        method: 'post',
        data:exceptionListData//data是传对象，对应body接收
    })
}
//update
export function updateExceptionInfoAPI(exceptionListData: ExceptionInfoData) {
    return request({
        url: '/warning/update_exception',//此处为自己请求地址
        method: 'post',
        data:exceptionListData//data是传对象，对应body接收
    })
}

//del,id
/*export function delExceptionInfoAPI(delPatchList: DelPatchListData) {
    return request({
        url: '/warning/delete_warning',//此处为自己请求地址
        method: 'post',
        data: delPatchList

    })
}*/

//del,看看要id还是什么，先传对象
export function delExceptionInfoAPI(delPatchList: DelPatchListData) {
    return request({
        url: '/warning/delete_warning',//此处为自己请求地址
        method: 'post',
        data:delPatchList
    })
}

//del,看看要id还是什么，先传对象
export function getImagesByid(id: number) {
    return request({
        url: '/warning/view_warning',//此处为自己请求地址
        method: 'get',
        params: {
            id:id
        }
    })
}
